﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using AccessControl.Contracts.Models;

namespace AccessControl.Data.Models
{
    /// <summary>
    /// Represents user in the system
    /// </summary>
    /// <remarks></remarks>
    public class User : Model, IUser
    {
        #region Fields

        string _Name;
        ObservableCollection<IEntry> _AllowedEntries = new ObservableCollection<IEntry>();

        #endregion

        #region Public Properties

        /// <summary>
        /// Gets or sets the name.
        /// </summary>
        /// <value>
        /// The name.
        /// </value>
        public string Name
        {
            get { return _Name; }
            set
            {
                if (_Name != value)
                {
                    _Name = value;
                    NotifyPropertyChanged("Name");
                }
            }
        }

        /// <summary>
        /// Gets the allowed entries.
        /// </summary>
        public IList<IEntry> AllowedEntries
        {
            get { return _AllowedEntries; }
        }
        
        
        #endregion
    }
}
